package milkyway.hightech.conditions;

import java.util.ResourceBundle;

/**
 *
 * @author michael
 */
public class InvAccountCond
{
    private InvCondTypes conditionType;
    private double creditInterest;
    private ResourceBundle rb;

    /**
     *
     * @param creditInterest
     * @param conditionType
     * @param rb
     */
    public InvAccountCond(double creditInterest,
        InvCondTypes conditionType, ResourceBundle rb)
    {
        this.creditInterest = creditInterest;
        this.rb = rb;
        this.conditionType = conditionType;
    }

    /**
     *
     * @return
     */
    public double getCreditInterest()
    {
        return creditInterest;
    }

    /**
     *
     * @return
     */
    public int getContractPeriod()
    {
        return conditionType.getValue();
    }

    /**
     *
     * @return
     */
    @Override
    public String toString()
    {
        String data = "";
        String period = rb.getObject("contractPeriod").toString();
        String condition = rb.getObject(conditionType.toString()).toString();
        String interest = rb.getObject("creditInterest").toString();

        data += period + condition + "\n"
            + interest + creditInterest + " % p.A.\n";

        return data;
    }
}


//~ Formatted by Jindent --- http://www.jindent.com
